<?php

require __DIR__ . '/DataClient.php';
//用户access_token
define("API_KEY", "360提供");
define("ACCESS_TOKEN", "16018565724120ed7120e5055b1bd58a7046b647b4070845e");

function keywordcount()
{
    $dc = new DataClient(API_KEY, ACCESS_TOKEN);
    
    $param = array();
    $param['startDate'] = "2014-04-09";
    $param['endDate']   = "2014-04-09";
    $param['level']     = "account";
    
    $dcdata = $dc->api("report.keywordCount", $param);
    
    var_dump($dcdata);
}

function keyword()
{
    $dc = new DataClient(API_KEY, ACCESS_TOKEN);
    
    $param = array();
    $param['startDate'] = "2014-04-09";
    $param['endDate']   = "2014-04-10";
    $param['level']     = "account";
    
    $dcdata = $dc->api("report.keyword", $param);
    
    var_dump($dcdata);
}
function creative()
{
    $dc = new DataClient(API_KEY, ACCESS_TOKEN);
    
    $param = array();
    $param['startDate'] = "2014-04-09";
    $param['endDate']   = "2014-04-10";
    $param['level']     = "account";
    
    $dcdata = $dc->api("report.creative", $param);
    
    var_dump($dcdata);
}


function allObjects()
{
    $dc = new DataClient(API_KEY, ACCESS_TOKEN);
    
    $param = array();
    //$param['startDate'] = "2014-04-09";
    //$param['endDate']   = "2014-04-10";
    //$param['level']     = "account";
    
    $dcdata = $dc->api("account.getAllObjects", $param);
    
    var_dump($dcdata);
    
    $param['fileId']     = $dcdata['fileId'];
    $dcdata = $dc->api("account.getFileState", $param);
    
    
    var_dump($dcdata);
}

creative();
